package com.daumcorp.searchdata.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.daumcorp.searchdata.bookstore.BookStoreService;
import com.daumcorp.searchdata.domain.Book;

@Controller
@RequestMapping("/book")
public class HelloController {
	@Autowired
	private BookStoreService service;

	@RequestMapping(value = "/product/{isbn}", produces="application/json")
	@ResponseBody
	public Book hello(@PathVariable String isbn) {
		return service.findBook(isbn);
	}
}